class UrlMappings {

	static mappings = {
		"/$controller/$action?/$id?"{
			constraints {
				// apply constraints here
			}
        }

        "/player/transfer/$fromPlayerId/$toPlayerId/$amount"(controller:'player'){

            action = [GET: "transfer"]
            constraints {
                // apply constraints here
            }
        }

        "/game/creategame"(controller:'game'){

            action = [POST:"createGame"]
            constraints {
                // apply constraints here
            }
        }

        "/game/find/$gameName"(controller: 'game') {
            action = [GET: "findGame"]
            constraints {

            }
        }

        "/player/addPlayerToGame/$gameName/$playerName"(controller: 'player')     {
            action = [PUT:"addPlayerToGame"]
        }

		"/"(view:"/index")
		"500"(view:'/error')

        "/player" (controller: "player") {
            action = [GET:"show", POST:"save", PUT:"update", DELETE:"remove"]
        }

        "/game" (controller: "game") {
            action = [GET:"show", POST:"save", PUT:"update", DELETE:"remove"]
        }
	}
}
